<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<title>会计科目新增</title>
		<link rel="stylesheet" type="text/css" href="css/public.css">
		<script language="JavaScript" charset="UTF-8" src="js/public.js"></script>
		<script type="text/javascript" charset="UTF-8" src="js/date1.js"></script>
		<script type="text/javascript" charset="UTF-8" src="js/sorttable.js"></script>
		<script type="text/javascript" charset="UTF-8" src="js/validate.js"></script>
		
		<script type="text/javascript">
			function a(){
					var check = document.getElementsByName("checkbox");
					var hidden = document.getElementById("hidden") ;
					var va="";
					for(var i=0;i<check.length;i++){
						if(check[i].checked){
							va=va+'1,';
							}
						else{
							va=va+'0,';
							}
					}
					hidden.value=va ;
					
					
			}
			function validate()
			{	
			a();
			var code = document.getElementById("code");
			var name = document.getElementById("name");
			var help = document.getElementById("help");
					
			//验证科目代码
			if(!isNotNull(code,'科目代码')||!f_check_number(code,'科目代码')||!f_check_NumLength(code,'科目代码'))
				return false ;
			//验证助记码
			if(isNull(help,'助记码'))
				;
			else if(!f_check_NumOrLett(help,'助记码')||!f_check_NumLength(help,'助记码'))
				return false ;		
						
			//验证科目名称
			if(!isNotNull(name,'科目名称')||!f_check_ZhOrNumOrLett(name,'科目名称')||!f_check_NumLength(name,'科目名称'))
				return false ;	
				
			
		}
		</script>
		
		<style type="text/css" >
			/*新增界面*/
#newaccountbook
		{
			margin:4px;
			font-size:9pt;
			height:358px;
			width:410px;
			color: #403040;
			background:#FBFBFB;
		}
		/*顶部按钮*/
		#accounttop_btn
		{
			height:25px;
			text-align:left; 
			margin-left:4px;
			margin-top:6px;
		}
		/*科目设置*/
		#subject_set
		{
			display:block;
		}
		/*科目信息*/
		#subject_set .subjecttable
		{
			margin-left:10px;
			width:398px;
			
		}
		#subject_set .subjecttable table
		{color: #403040;background:#FBFBFB;}
		
		/*科目设置选择功能框*/
		#subject_set .subjectfunc
		{
			margin-top:4px;
			margin-left:6px;
			color: #403040;
			margin-right:6px;
			width:100%;
		}
		#subject_set .subjectfunc table
		{color: #403040;background:#FBFBFB;}
		/*核算项目*/
		#calculation_project
		{
			display:none;
		}
		/*核算项目显示框*/
		#calculation_project .calculateinfo
		{
			argin-top:-4px;
			margin-left:4px;
		}
		/*核算项目信息显示表格*/
		#calculation_project .calculatetable
		{
			width:398px; 
			border-right:1px solid #e6f0fd;
			text-align:center;
			color: #403040;
		}
		
		/*核算项目增加和删除按钮*/
		#calculation_project .calculatebtn
		{
			margin-top:-8px; 
			text-align:center;
			background:#FBFBFB;
		}
		/*底部按钮*/
		#accountbtm_btn
		{
			text-align:center;
			float:bottom; 
			margin-bottom:6px;
		}
		
		</style>
	</head>
	<body>
	<div id="info_all" style="width:420px;">
		<div id="info_top">
				会计科目新增
		</div>
		<s:form  action="addAccountbook.action" method="post" theme="simple" onsubmit=" return validate()">
		<div id="newaccountbook">
			<hr>
			<div id="subject_set">
				<div class="subjecttable">
					<table>
						<tr>
							<td width="90px">
								科目代码*：
							</td>
							<td colspan="3">
								<s:hidden id="hidden" name="hidden"></s:hidden>
								<s:textfield name="pbaseAccountbook.accountbookCode" size="42" id="code"></s:textfield>
							</td>
						</tr>
						<tr>
							<td>
								助记码：
							</td>
							<td colspan="3">
								<s:textfield name="pbaseAccountbook.shortName" size="42" id="help"></s:textfield>
							</td>
						</tr>
						<tr>
							<td>
								科目名称*：
							</td>
							<td colspan="3">
								<s:textfield name="pbaseAccountbook.accountbookName" size="42" id="name"></s:textfield>
							</td>
						</tr>
						<tr>
							<td>
								科目类别*：
							</td>
							<td width="136px">
								<s:select list="#{'1':'流动资产'}" name="pbaseAccountbook.accountbookTypeId"></s:select>							
								&nbsp;&nbsp;
							</td>
							<td width="80px">
								余额方向：
							</td>
							<td width="90px">
								<s:select list="#{'1':'借','0':'贷'}" name="pbaseAccountbook.banlanceDirection"></s:select>
							</td>
						</tr>
						<tr>
							<td>
								外币核算：
							</td>
							<td>
								<s:select list="#{'':'不核算','0':'港币','1':'美元','2':'欧元','3':'日元'}" name="pbaseAccountbook.foreignCurrency"></s:select>
							</td>						
							<td>
							<input type="checkbox" name="checkbox" >
								期末调汇
							</td>
						</tr>
					</table>
				</div>
				<div class="subjectfunc">
					<div style="float: left;">
						<input type="checkbox" name="checkbox" >
						往来业务核算
						<br />
						<input type="checkbox" name="checkbox" >											
						数量金额辅助核算	
						<br />
																						
						<input type="checkbox" name="checkbox" >
						现金科目
						<br />
																			
						<input type="checkbox" name="checkbox" >
						银行科目
						<br />
						<input type="checkbox" name="checkbox" >															
						出日记账
						<br />
						<input type="checkbox" name="checkbox" >																
						现金等价物
					</div>
					<div style="float: right;">
						<table>
							<tr>
								<td>
									单位组：
								</td>
								<td>
									<select>
										<option>
											&nbsp;
										</option>
										<option>
											打印机数量组
										</option>
										<option>
											电脑配件数量组
										</option>
										<option>
											电脑数量组
										</option>
										<option>
											手机数量组
										</option>
									</select>
								</td>
							</tr>
							<tr>
								<td>
									缺省单位：
								</td>
								<td>
									<select>
										<option>
											&nbsp;
										</option>
										<option>
											台
										</option>
										<option>
											片
										</option>
										<option>
											盒
										</option>
										<option>
											个
										</option>
									</select>
								</td>
							</tr>
						</table>
					</div>
				</div>
			</div>
	
			<hr>
			<div id="accountbtm_btn">
				<input type="submit" value="保存" onFocus="this.blur()"
					onmouseover="this.className='btnover'"
					onmouseout="this.className='btnout'" class="btnsize"/>
				&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				<input type="button" value="返回" onFocus="this.blur()"
					onmouseover="this.className='btnover'"
					onmouseout="this.className='btnout'" class="btnsize" onclick="javascript:history.back()"/>
			</div>
		</div>
		</s:form>
		</div>
		<script type="text/javascript">
					getTitle('code','会计科目');	
					var check = document.getElementsByName("checkbox");
					var hidden = document.getElementById("hidden").value ;
					var va= hidden.split(','); 
				
					for(var i=0;i<check.length;i++){
						if(va[i]=='1'){
							check[i].checked=true;
							}					
					}							
		</script>
	</body>
</html>
